package com.google.android;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;


import longtdbk.android.job.data.JobData;


/**
 * jobDetail Activity for JobShow.
 * 
 * @author longtdbk
 */
public class JobDetailActivity extends Activity {

    private static final String CLASSTAG = JobDetailActivity.class.getSimpleName();

    public static JobData jobData = null;

    private Button buttonWeb;
    private TextView company;
    private TextView location;
    private TextView phone;


    @Override
    public void onCreate(final Bundle icicle) {
        super.onCreate(icicle);
        Log.v(Constants.LOGTAG, " " + JobDetailActivity.CLASSTAG + " onCreate");

        this.setContentView(R.layout.jobdetail_activity);

        this.buttonWeb = (Button) findViewById(R.id.button_web);
        this.company = (TextView) findViewById(R.id.bd_company);
        this.location = (TextView) findViewById(R.id.bd_location);
        this.phone = (TextView) findViewById(R.id.bd_phone);


        this.company.setText(JobDetailActivity.jobData.company);
        this.location.setText("Vi tri:" + JobDetailActivity.jobData.location);
        this.phone.setText("Dien Thoai: "
            + (JobDetailActivity.jobData.phone != null ? JobDetailActivity.jobData.phone : "NA"));

        this.buttonWeb.setOnClickListener(new OnClickListener() {

            public void onClick(View v) {
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(JobDetailActivity.jobData.link)));
            };
        });
    }

    @Override
    public void onStart() {
        super.onStart();
        Log.v(Constants.LOGTAG, " " + JobDetailActivity.CLASSTAG + " onStart");
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    @Override
    public void onPause() {
        super.onPause();
    }
}
